#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/loggedTemplate.xhtml">
	
	<f:metadata>
		<f:event type="preRenderView"
			listener="${symbol_pound}{usuarioBean.initConversation}" />
	</f:metadata>
	
	<ui:define name="content">
		
		<h1>${symbol_pound}{msg['usuario.titulo.cadastro']}</h1>
		
		<h:form id="usuarioForm">
			
			<p:messages />
			
			<p:panelGrid columns="3">
				${symbol_pound}{msg['usuario.nome']}
				<p:inputText value="${symbol_pound}{usuarioBean.entidade.nome}" id="nome" label="${symbol_pound}{msg['usuario.nome']}" />
				<p:message for="nome" />
				
				${symbol_pound}{msg['usuario.login']}
				<p:inputText value="${symbol_pound}{usuarioBean.entidade.login}" id="login" label="${symbol_pound}{msg['usuario.login']}" />
				<p:message for="login" />
				
				${symbol_pound}{msg['usuario.senha']}
				<p:inputText value="${symbol_pound}{usuarioBean.entidade.senha}" id="senha" label="${symbol_pound}{msg['usuario.senha']}" />
				<p:message for="senha" />
				
				${symbol_pound}{msg['usuario.papeis']}
				<p:pickList id="papeis" value="${symbol_pound}{usuarioBean.papeis}" var="papel"   
                	itemLabel="${symbol_pound}{papel.nome}" itemValue="${symbol_pound}{papel}">
                	<f:converter converterId="pickListEntityConverter" />
                </p:pickList>
				<p:message for="papeis" />
			</p:panelGrid>
			
			<p:commandButton value="${symbol_pound}{msg['botao.salvar']}" action="${symbol_pound}{usuarioBean.salvar}" update="usuarioForm" />
			<p:commandButton value="${symbol_pound}{msg['botao.cancelar']}" action="${symbol_pound}{usuarioBean.cancelar}" immediate="true" />
			
		</h:form>

	</ui:define>
</ui:composition>
